<template>
  <div>
    <basic-container>
      <avue-detail :option="option1" v-model="form"></avue-detail>
      <avue-crud :data="crudData" :option="option2">

      </avue-crud>
    </basic-container>
  </div>
</template>

<script>
import { detailOption, crudOption } from '../../const/crud/supply/orderdetailoption'
import { getDetail } from '@/api/crm/salesorder'
export default {
  data() {
    return {
      option1: detailOption,
      option2: crudOption,
      form: {},
      crudData: []
    }
  },
  created() {
    this.form = this.$route.query
    // console.log(this.form)
    this.getInventory()
  },
  methods: {
    getInventory() {
      const params = { salesOrderSn: this.$route.query.salesOrderSn }
      getDetail(params).then(res => {
        this.crudData = res.data.data.detailList
        console.log(this.crudData)
      })
    }
  }
}
</script>

<style>

</style>
